﻿#include "widget.h"
#include "ui_widget.h"
#include "capture/widget/capturewidget.h"
#include <QClipboard>
#include <QApplication>

Widget::Widget(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::Widget)
{
    ui->setupUi(this);
}

Widget::~Widget()
{
    delete ui;
}

void Widget::on_BTN_Cut_clicked()
{
    CaptureWidget* captureWidget = new CaptureWidget(this);
    //connect(captureWidget, SIGNAL(capturePixmap(const QPixmap&)), this, SLOT(onCapturePixmap(const QPixmap&)));
    captureWidget->show();
}

void Widget::onCapturePixmap(const QPixmap &pic)
{
    QClipboard *clipboard = QApplication::clipboard();
    clipboard->setPixmap(pic);
}
